
{include file="Include/H_ui_head" /}

<article class="page-container">
    <div class="page-container">
        <form action="javascript:;" method="post" class="form form-horizontal" id="form-admin-add" enctype="multipart/form-data">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>充值筹码：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text " value="" placeholder="" id="jetton" name="jetton">
                </div>
            </div>
            <input type="hidden" value="{$result['user_id']}" name="user_id" id="user_id">
            <div class="row cl" id="sub">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">

                        <button class="btn btn-primary radius" onclick="return edit()"> 提交</button>
                        <button class="btn btn-primary radius" onclick="javascript:window.history.back(-1);" style="background-color:#5eb95e; border-color:#5eb95e;"> 返回</button>
                    </div>
                </div>
        </form>
    </div>
</article>
{include file="Include/H_ui_foot" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">

    $(function(){
        $(".permission-list dt input:checkbox").click(function(){
            $(this).closest("dl").find("dd input:checkbox").prop("checked",$(this).prop("checked"));
        });
        $(".permission-list2 dd input:checkbox").click(function(){
            var l =$(this).parent().parent().find("input:checked").length;
            var l2=$(this).parents(".permission-list").find(".permission-list2 dd").find("input:checked").length;
            if($(this).prop("checked")){
                $(this).closest("dl").find("dt input:checkbox").prop("checked",true);
                $(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop("checked",true);
            }
            else{
                if(l==0){
                    $(this).closest("dl").find("dt input:checkbox").prop("checked",false);
                }
                if(l2==0){
                    $(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop("checked",false);
                }
            }
        });

    });

    function edit()
    {
        var params = $('form').serializeArray();
        var loading =layer.msg('正在提交数据，请稍后...',{time:5000});
        $.post('{:url("Member/edit_recharge")}',params,function(data){
            layer.close(loading);
            if(data=='1'){
                layer.msg('充值成功',{time:2000});
                setTimeout(function(){
                    // layer_close(this.index);
                    parent.location.reload();
                var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                parent.layer.close(index);
                    // window.location.href="{:Url('admin/member/recharge')}";
                },1000);
            }else{
                layer.msg('充值失败',{time:2000});
            }
        });
    }

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
